//
//  SWWellcomeViewController.swift
//  SinaWeibo
//
//  Created by AenyMo on 16/4/1.
//  Copyright © 2016年 AenyMo. All rights reserved.
//

import UIKit

class SWWellcomeViewController: UIViewController {
    
    //加载视图的时候 就获取数据信息
    override func loadView() {
        //替换默认View
        view = backgroundImage
    }
    

    override func viewDidLoad() {
        super.viewDidLoad()

        view.addSubview(iconView)
        view.addSubview(wellcomeLabel)
        
    }
    
    //MARK: - 布局子控件
    override func viewWillLayoutSubviews() {
        //
    }
    
    //MARK: - 懒加载UI控件
    lazy var backgroundImage: UIImageView = UIImageView(image: UIImage(named: "ad_background"))
    
    lazy var iconView: UIImageView = {
        //加载图片
        let iconView = UIImageView(image: UIImage(named: "avatar_default_big"))
        //裁剪图片
        iconView.layer.cornerRadius = 45
        iconView.layer.masksToBounds = true
        
        return iconView
    }()
    
    lazy var wellcomeLabel: UILabel = {
        
       let label = UILabel()
        label.text = "欢迎回来"
        
        return label
    }()

}
